home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks96 / FlyPaper.sit / Fly Paper / FlyPaper Source / App Sources / filter.h < prev    next >
Text File  |  1996-06-22  |  2KB  |  55 lines

  1. // File "filter.h" - 
  2.  
  3. #ifndef ____FILTER_HEADER____
  4. #define ____FILTER_HEADER____
  5.  
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. // * ****************************************************************************** *
  11.  
  12. // Information on the program's precompiled jGNEFilter
  13. #define kJGNEFilterResType        'jGNE'
  14. #define kJGNEFilterResID        128
  15.  
  16. // Constant offsets into jGNEFilter for inline data
  17. #define kNextFilterOffset        0x02
  18. #define kEventHelperOffset        0x06
  19. #define kEventHelperDataOffset    0x0A
  20.  
  21. // Declare a Guide for Passing the Filter Helper, for Universal Headers
  22. #if !GENERATINGPOWERPC
  23. typedef void (*FilterHelperProcPtr)(EventRecord *theEvent, Ptr helperData);
  24. typedef FilterHelperProcPtr FilterHelperUPP;
  25. enum {
  26.     uppFilterHelperProcInfo = 0
  27.     };
  28. #define NewFilterHelperProc(proc)    (FilterHelperUPP)(proc)
  29. #else
  30. typedef UniversalProcPtr FilterHelperUPP;
  31. enum {
  32.     uppFilterHelperProcInfo = kCStackBased
  33.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(EventRecord *)))
  34.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
  35.     };
  36. #define NewFilterHelperProc(proc) (FilterHelperUPP) \
  37.         NewRoutineDescriptor((ProcPtr)(proc), uppFilterHelperProcInfo, GetCurrentISA())
  38. #endif GENERATINGPOWERPC
  39.  
  40. // * ****************************************************************************** *
  41. // * ****************************************************************************** *
  42. // Function Prototypes
  43.  
  44. Ptr InstallEventFilter(FilterHelperUPP helperProc, Ptr helperData);
  45. Ptr ReleaseEventFilter(Ptr filterProc);
  46.  
  47. void EventFilterHelper(EventRecord *theEvent, Ptr helperData);
  48.  
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52.  
  53. #endif  ____FILTER_HEADER____
  54.  
  55.